KISSY.use("node",function(S,Node){ 
var hide;
var show;
var last_key;
$(".panel-content").on("mouseleave",function(){if(last_key){hide.run();}});
$(".tasks").on("click",function(){
	var key = $(this).attr("data-amk");
	if(last_key&&last_key!=key){hide.run();}
	show = KISSY.Anim("."+key,{"height":"320px"},0.3,"easeIn",function(){});
	hide = KISSY.Anim("."+key,{"height":"0px"},0.3,"easeIn",function(){$("."+key).addClass("hide");});
	if($("."+key).hasClass("hide")){
		$("."+key).removeClass("hide");
		show.run();
		last_key=key;
	}else{
		hide.run();
	}
});
$(".assign").on("click",function(){
	var toolid=$(this).attr("data-toolid");
	showDialog("开通工具","<img src='http://img03.taobaocdn.com/tps/i3/T1b1m3XkVpXXXXXXXX-32-32.gif' />正在开通，请稍等。。。","tools");
	KISSY.io({
			url: "/?a=assigntool&m=shop&c=tools",
			data: {"toolid":toolid},
			success: function(data, textStatus) {
			closeDialog();
				if(data.status==false){
					showDialog("开通工具","工具开通失败。。。原因如下<br />"+data.msg,"tools");
				}else{
					showDialog("开通工具","已成功开通工具！","tools");
				}
			},
			complete: function(data){
			},
			error: function(){
				alert('error');
			},
			dataType:"jsonp"
	});
});
});